var app=angular.module("loginApp", [])
app.controller("loginController" ,function($scope,userService){
	
	//登录触发按钮
	$scope.onClicklogin=function(){
		
	
		userService.login($scope.name,$scope.pwd).then(
				function successCallback(response) {
					var res=response.data.rs;
				
					if("Y"==res){
						window.location.href="/test/order.html";
					}else if("N1"==res){
						$scope.msg="密码错误";
						$("#myModal").modal('show');
					}else if("N"==res){
						$scope.msg="用户名不存在";
						$("#myModal").modal('show');
					}
					
					
			
			}, function errorCallback(response) {
				// 请求失败执行代码
			});
		
	}
	
	
	
	
	
	
	

})